package com.lingshi.shopping.exception;

import com.lingshi.shopping.enums.ErrorEnums;

/**
 * 业务异常类
 */
public class BusException extends RuntimeException {

    private Integer code;

    private String msg;

    public BusException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusException(ErrorEnums errorEnums) {
        this.code = errorEnums.getCode();
        this.msg = errorEnums.getMessage();
    }


    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
